<template>
  <el-dialog :visible="showTimeline" title="物流进度" @close='close'>
    <el-timeline >
      <el-timeline-item
        v-for="(item, index) in list"
        :key="index"
        :timestamp="item.time"
      >
        {{ item.context }}
      </el-timeline-item>
    </el-timeline>
  </el-dialog>
</template>

<script>
import { logistics } from '@/api/orders'
export default {
  props: {
    showTimeline: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      list: []
    }
  },
  methods: {
    async getLogistics (id) {
      const res = await logistics(1106975712662)
      this.list = res
    },
    close () {
      this.$emit('update:showTimeline', false)
      this.list = []
    }
  }
}
</script>

<style>
</style>
